package java6681.generic;

/**
 * @author Junichiro
 * @description 自定义泛型类
 * @date 2021-04-11 11:01
 **/

public class MyMath6681<T> implements Comparable<MyMath6681> {
    private T key;
    private T value;

    public MyMath6681() {
    }

    public MyMath6681(T key, T value) {
        this.key = key;
        this.value = value;
    }

    public T getKey() {
        return key;
    }

    public void setKey(T key) {
        this.key = key;
    }

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }
    public <T extends Comparable<T>> T max(T key, T value){
        T t = key.compareTo(value) > 0 ? key : value;
        return t;
    }

    public <T extends Comparable<T>> T min(T key, T value){
        T t = key.compareTo(value) <0 ? key : value;
        return t;
    }

    @Override
    public int compareTo(MyMath6681 m) {

        return 0;
    }


}
